package com.qf.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class UserDto {

    private Integer id;

    //角色id
    @NotNull(message = "【角色id】不能为空")
    private Integer roleId;
    //员工姓名
    @NotNull(message = "【员工姓名】不能为空")
    private String workName;
    //性别
    @NotNull(message = "【性别】不能为空")
    private String sex;
    //入职时间
    @NotNull(message = "【入职时间】不能为空")
    private Date createTime;
    //出生日期
    @NotNull(message = "【出生日期】不能为空")
    private Date birthday;
    //员工电话
    @NotNull(message = "【员工电话】不能为空")
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$", message = "【电话】规则不正确")
    private String workPhone;
    //员工身份证
    @NotNull(message = "【员工身份证】不能为空")
    private String idCard;
}
